<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ include file="/WEB-INF/views/include/mobile-header.jsp"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1.0, user-scalable=0">
<title>添加地址</title>
<link href="${ctxStatic }/site/themes/default/css/boilerplate.css" rel="stylesheet" type="text/css">
<link href="${ctxStatic }/site/themes/default/css/css.css" rel="stylesheet" type="text/css">
<script src="${ctxStatic }/site/themes/default/js/respond.min.js"></script>
<script type="text/javascript" src="${ctxStatic }/site/themes/default/js/pccs.js"></script>

<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript"></script>
<script src="${ctxStatic}/site/themes/default/js/hideOptionMenu.js" type="text/javascript"></script>

<script type="text/javascript">
$(function(){
	$("#move").mouseover(function(){
		$("#moveshow").addClass("show");
		$("#moveUl").show();
	});
	
	$("#move").mouseout(function(){
		$("#moveshow").removeClass("show");
		setInterval("$('#moveUl').hide();",5000);
	});
});

function checkForm(){
	
	var detail = $.trim($('#detail').val());
	var mobile = $.trim($('#mobile').val());
	var name = $.trim($('#name').val());
	var province = $.trim($('#province').val());
	var city = $.trim($('#city').val());
	var county = $.trim($('#county').val());
	
	if(name ==''||name==null){
		alert("请填写姓名!");
		return false;
	}
	
	
	if(mobile ==''||mobile==null){
		alert("请填写手机!");
		return false;
	}
	
	if(detail ==''||detail==null){
		alert("请填写详情!");
		return false;
	}
	
	
	if(province ==='省份' || province ===''){
		alert("请选择地址!");
		return false;
	}
	
	
	
	if(city ==='地级市' || city ===''){
		alert("请选择地址!");
		return false;
	}
	
	if(county ==='县,区' || county ===''){
		alert("请选择地址!");
		return false;
	}
	
	
	return true;
}

</script>
</head>
<body>
<div class="gridContainer clearfix" id="shopcar">
  <div id="LayoutDiv1" style="min-height:480px;">
      <header>    
		    <ul class="menu">  
		    <span style=" font-size:18px; color:#FFF" class="left biaoti icon_left"   onclick="history.back(-1)" >地址添加</span>
					<li id="moveshow" > <a href="#" id="move"  ><span class="icon_menu right"></span></a>
						<ul id="moveUl" style="display:none;">
							<jsp:include page="./right.jsp"></jsp:include>
						</ul>
					</li>			
				</ul>
		    </header>
    <section class="clear">
    <form:form id="inputForm" modelAttribute="memberAddress"
					action="${ctxFront }/site/shopping/saveAddress?productId=${productId }&type=${type }&productNumber=${productNumber}&way=${way}&buyWay=${buyWay}&flowerId=${flowerId}"
					method="post" class="form-horizontal"  onsubmit="return checkForm();" >
					<input type="hidden" name="uid" value="${uid }">
					<input type="hidden" name="wechatId" value="${wechatId }" />
					<form:hidden path="id" />
					<form:hidden path="user.id" value="${uid }" />
					<form:hidden path="addType" value="0" />
      <dl style="border:1px #eee solid; border-radius:3px; padding:1%; width:92%; margin:2%; float:left">
        <dd style="border-bottom:1px #eee solid; padding:3%; font-size:16px">收货人名：
          <form:input path="name" htmlEscape="false" maxlength="11" class="required px addresstxt" value="" />
        </dd>
        <dd style="border-bottom:1px #eee solid; padding:3%; font-size:16px">手机号码：
          	<form:input path="mobile" htmlEscape="false" class="required px addresstxt" />
        </dd>
        <dd style="border-bottom:1px #eee solid; padding:3%; font-size:16px">收货地区：
        	<%-- ${memberAddress.province}-${memberAddress.city}-${memberAddress.county} --%>
        	<select name="province" id="province" class="px1 addresssele" ></select>
        	<select	name="city" id="city" class="px1 addresssele" ></select> 
			<select	name="county" id="county" class="px1 addresssele" ></select>
        </dd>
        <script language="javascript">
	        setup('${memberAddress.province}','${memberAddress.city}','${memberAddress.county}');
	    </script>
        <dd style="border-bottom:1px #eee solid; padding:3%; font-size:16px"><span style="text-align: right">详细地址：</span>
          <form:textarea path="detail" htmlEscape="false" class="required px" style="border:1px #999999 solid; border-radius:5px; width:66%; height:70px;" />
        </dd>
        <dd style="border-bottom:1px #eee solid; padding:3%; font-size:16px">
        <span>
        	 <label class="checkbox" for="checkbox3"> 
        	 <form:checkbox	path="selected" htmlEscape="false" value="1" id="checkbox3"	data-toggle="checkbox" /> 
        	 <span style="margin-top: -20px;">&nbsp;&nbsp;是否是默认地址</span>
			</label>
		</span>
        </dd>
        <input id="btnSubmit" class="anniu Orange" type="submit" value="保存并使用"  style="width:85%; padding:4%; margin:5%" />
      </dl>
      	</form:form>
      	
    </section>
  </div>
  <div class="jszch">技术支持：<a href="http://www.hdzhx.com/boxin/index.html" >智讯互联</a></div> 
</div>
</body>
</html>
